<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Category extends Model
{
    use SoftDeletes;
    protected $table = 'blog_category';

    const ROOT_LEVEL = 1;

    const ROOT_CATE  = 1;

    const TYPE_CATE = 1;

    const TYPE_TAG = 2;

    const TYPE_ALL = 3;

    public function getTypeName($type)
    {
        if(empty($type)){
            $type = $this->type;
        }
        switch ($type){
            case 1 :
                return '目录';
            case 2:
                return '标签';
            default:
                return '未知';
        }
    }
}
